﻿using System.Web;
using System.Web.Routing;
using MyClub.Web.Routing;

namespace MyClub.Web
{
    /// <summary>
    /// Provides a base class for the MyClub Global Application Class in ~/global.asax.cs.
    /// </summary>
    public class MyClubApplication: HttpApplication
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MyClubApplication"/> class.
        /// </summary>
        public MyClubApplication()
        {
        }

        /// <summary>
        /// Executes custom initialization code after all event handler modules have been added.
        /// </summary>
        public override void Init()
        {
            InitializeRouteTable();
        }

        /// <summary>
        /// Initializes the route table.
        /// </summary>
        private static void InitializeRouteTable()
        {
            RouteTable.Routes.Add(new PostRoute("~/Handlers/ArticlePost.aspx"));
            RouteTable.Routes.Add(new CategoryRoute("~/Handlers/Category.aspx"));
            RouteTable.Routes.Add(new PostFeedRoute("~/Handlers/PostFeed.ashx"));
        }

    }
}
